using System;
using System.Security.Cryptography;
using System.Text;
using System.Collections.Generic;
/// <summary>
/// Using implement description for encryption data
/// </summary>
public class Encryption
{
    /// <summary>
    /// Implement encryption data ,using algorithms MD5
    /// </summary>
    /// <param name="value">Value string will encription</param>
    /// <returns>String has encryption</returns>
    public static string ToMD5(string value)
    {
        MD5CryptoServiceProvider crypto = new MD5CryptoServiceProvider();
        byte[] source = System.Text.Encoding.UTF8.GetBytes(value);
        source = crypto.ComputeHash(source);
        StringBuilder encryptedString = new StringBuilder();
        foreach (byte temp in source)
        {
            encryptedString.Append(temp.ToString());
        }
        return encryptedString.ToString();
    }

}
